package com.ruoyi.common.result;


import lombok.Data;

@Data
public class Result <T> {
    String  message;
    int code;
    T data;

    public Result(T data , String message)
    {
        code = 200;
        this.message = message;
        this.data=data;
    }
    public Result()
    {
        code=200;
        message="success";
        this.data=null;
    }
    public Result(String message)
    {
        code=404;
        this.message=message;
        data=null;
    }

    public static  <T> Result<T> success(T data , String message)
    {
        return new Result<>(data , message);
    }
    public static <T> Result<T> success()
    {
        return new Result<>();
    }
    public static <T> Result<T> erro(String message)
    {
        return new Result<>(message);
    }
}
